package com.base.system.jpa.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.base.system.enums.UserState;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.annotations.Columns;

import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.HashSet;
import java.util.Set;

@Entity
@Table(name = "user")
@Data
@org.hibernate.annotations.Table(appliesTo = "user", comment = "用户信息表")
@Accessors(chain = true)
public class JpaUser extends JpaBaseEntity{
    @Id
    @Column(name = "id",columnDefinition="bigint COMMENT '主键，自动生成'")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    /**
     * 昵称
     */
    @Column(columnDefinition = "varchar(50) COMMENT '昵称'")
    private String nickName;

    /**
     * 真实名称
     */
    @Column(columnDefinition = "varchar(50) COMMENT '真实姓名'")
    private String realName;

    /**
     * 账号
     */
    @Column(length = 100,unique = true,nullable = true,columnDefinition = "varchar(50) not null COMMENT '账号'")
    private String userAcount;

    /**
     * 性别
     */
    @Column(columnDefinition = "varchar(2) COMMENT '性别'")
    private String sex;

    @Column(columnDefinition = "varchar(20) not null COMMENT '身份证'",unique = true)
    private String idNumber;

    @Column(columnDefinition = "varchar(11) not null COMMENT '联系电话'",unique = true)
    private String phone;

    @Column(columnDefinition = "varchar(50) not null COMMENT '邮箱'",unique = true)
    private String email;

    /**
     * 年龄
     */
    @Column(columnDefinition = "int COMMENT '年龄'")
    private Integer age;

    /**
     * 头像
     */
    @Column(columnDefinition = "varchar(200) COMMENT '头像'")
    private String actor;

    private UserState state = UserState.normal;

}
